package test.com;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;

import sun.misc.BASE64Encoder;


public class testRuning {
	public static void main(String[] args) throws Exception {
		jsonUtils json = jsonUtils.getInstance();
		desUtil des = desUtil.getInstance();
		String temp = null;
		createParams para = new createParams();
		para.setOstype("centos7.0");
		para.setDbtype("12.2.0.3");
		para.setCharsetType("AL32UTF8");
		para.setNationalType("AL16UTF16");
		para.setOraclePwd("oracle@123");
		para.setOraclePath("/u01");
		para.setHasDev(false);
		para.setMemUnit("GB");
		para.setInstanceMem(3);
		para.setInstanceName("shitan");
		para.setDatabasePwd("oracle@123");
		temp = json.serializeJson(para);
		System.out.println(temp);
		byte[] bty = des.encrypt(temp.getBytes("UTF-8"), "zzj198815".getBytes("UTF-8"));
		BASE64Encoder be = new BASE64Encoder();
		String BASE_PATH = System.getProperty("user.dir");
		BufferedWriter writer = new BufferedWriter(new FileWriter(new File(BASE_PATH + "/35ea17a8-1ca0-4620-b514-db5a3aaa7a73.lic")));
		writer.write(be.encode(bty));
		writer.close();
		System.out.println(be.encode(bty));
	}
}
